package org.orz.cloud.redis.autoconfigure;

import org.orz.cloud.redis.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.jedis.JedisConnection;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;

import java.io.Serializable;

@Configuration
@ConditionalOnClass({JedisConnection.class, RedisOperations.class})
@AutoConfigureAfter(org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration.class)
public class RedisAutoConfiguration {

    @Autowired
    public RedisAutoConfiguration(RedisTemplate stringRedisTemplate) {
        RedisUtil.setStringRedisTemplate(stringRedisTemplate);
    }
}
